using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

namespace UnitTestWinRTConverters.ObjectsTestBase
{
    public class UITextBoxTest : UIObjectTestBase
    {
        private readonly TextBox _textBox;

        public override object ConvertValue 
        { 
            get
            {
                return _textBox.Text;
            }
        }

        public string TextValue
        {
            set
            {
                _textBox.Text = value;
            }
        }

        public UITextBoxTest(IValueConverter converter, object value, object converterParameter = null)
            : base(converter, BindingMode.TwoWay, value, converterParameter)
        {
            _textBox = new TextBox();
            _textBox.SetBinding(TextBox.TextProperty, this.BindingObject);    
        }
    }
}
